package com.paddyi.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.paddyi.commons.http.HttpResult;
import com.paddyi.service.IDocumentService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *  (Document)
 * @author paddy
 * @since  2019-08-05 06:40:35
 */
@RestController
@RequestMapping("document")
public class DocumentController extends BaseController{

	@Reference(version = "${demo.service.version}")
	private IDocumentService documentService;


    /**
     * @return
     */
	@PostMapping(value="/findPage")
	public HttpResult findPage() {
		List docList = documentService.findAll();
		return HttpResult.ok(docList);
	}

    /**
     * 根据主键查询
     * @param id
     * @return
     */
	@GetMapping(value="/findById")
	public HttpResult findById(@RequestParam Long id) {
		return HttpResult.ok(documentService.getById(id));
	}
}
